<?php
namespace App\Model;

/**
 * @Author:: HuangYin
 * @DateTime: 2017-01-16 11:08
 *
 * @Description:
 */
class Goods extends BaseModel
{
    // 上架
    const ON_SHELVES = 1;

    // 下架
    const OFF_SHELVES = 2;

    protected $table = 'goods';

    protected $visible = ['id', 'goods_id', 'category_id','taocang_id', 'categoryName','taocangName', 'article_no', 'bar_code', 'zh_name', 'en_name', 'mnemonic',
        'brand', 'tax', 'price', 'inventory', 'status', 'created_at'];

    public function category()
    {
        return $this->hasOne('App\Model\GoodsCategory', 'category_id', 'category_id');
    }
    public function taocang()
    {
        return $this->hasOne('App\Model\TaoCang', 'id', 'id');
    }
}